<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

define('VAR_MOD', 'mod');
define('VAR_ACT', 'act');
define('COOKIE_PREFIX', '__jAdmin_');
define('COOKIE_DOMAIN', '');
define('COOKIE_PATH', '');
define('COOKIE_EXPIRE', 0);

//一般设置
$GLOBALS['_CONFIG'] = array(
    'siteName' => 'jAdmin',
    'ver' => '0.1'
);

//模块
$GLOBALS['JA_CONFIG'] = array(
    'modules' => array(
        'app' => array(
            'name' => '应用管理',
            'description' => '应用管理的介绍',
            'class' => 'JcApp',
            'actions' => array(
                'list' => array('showList', '应用列表', 1),
                'add' => array('showAdd', '添加应用', 1),
                'doadd' => array('doAdd', '添加提交', 0),
                'edit' => array('showEdit', '编辑应用', 0),
                'doedit' => array('doEdit', '编辑提交', 0),
                'dodelete' => array('doDelete', '删除提交', 0),
            ),
            'permission' => array() //用户组ID
        ),
        'user' => array(
            'name' => '用户管理',
            'description' => '系统用户管理',
            'class' => 'User',
            'actions' => array(
                'list' => array('showList', '用户列表', 1),
                'add' => array('showAdd', '添加用户', 1),
                'doadd' => array('doAdd', '添加提交'),
                'edit' => array('showEdit', '编辑用户'),
                'doedit' => array('doEdit', '编辑提交'),
                'dodelete' => array('doDelete', '删除提交'),
                'dolock' => array('doLock', '锁定提交'),
                'doactive' => array('doActive', '激活提交'),
            ),
        ),
        'role' => array(
            'name' => '角色管理',
            'description' => '用户角色权限管理',
            'class' => 'Role',
            'actions' => array(
                'list' => array('showList', '角色列表', 1),
                'add' => array('showAdd', '添加角色', 1),
                'doadd' => array('doAdd', '添加提交'),
                'edit' => array('showEdit', '编辑角色'),
                'doedit' => array('doEdit', '编辑提交'),
                'dodelete' => array('doDelete', '删除提交'),
            ),
        ),
    ),
    'default' => array('app', 'add')
);

//权限
$GLOBALS['JA_PERMISSION_CONFIG'] = array(
    1 => array(
        'name' => '用户添加',
        'method' => array('User::showAdd', 'User::doAdd')
    ),
    2 => array(
        'name' => '用户编辑',
        'method' => array('User::showEdit', 'User::doEdit')
    ),
    3 => array(
        'name' => '用户删除',
        'method' => array('User::doDelete')
    ),
    4 => array(
        'name' => '用户锁定',
        'method' => array('User::doLock')
    ),
    5 => array(
        'name' => '应用添加',
        'method' => array('JcApp::showAdd', 'JcApp::doAdd')
    ),
    6 => array(
        'name' => '应用编辑',
        'method' => array('JcApp::showEdit', 'JcApp::doEdit')
    ),
    7 => array(
        'name' => '应用删除',
        'method' => array('JcApp::doDelete')
    ),
);

//数据库
$GLOBALS['DB_CONFIG'] = array(
    'charset' => 'UTF8',
    'db' => 'jcomment',
    'prefix' => 'jc_',
    'rw_separate' => false, //读写分离
    'server' => array(
        array('localhost', 3306, 'root', '', 0), //第一个为主服务器 负责写
        array('localhost', 3306, 'root', '', 0),
    )
);

//错误代码
$GLOBALS['ERROR_CODE'] = array(
    1 => '数据库连接失败!',
    2 => '参数错误，找不到模块',
    3 => '参数错误，找不到动作',
    4 => '类不存在',
    5 => '应用名称必填！',
    6 => 'ID错误，找不到该应用',
    7 => ''
);
?>
